package com.example.demo.service.impl;

import com.example.demo.dao.ClassificationTableDao;
import com.example.demo.dao.CommodityListDao;
import com.example.demo.pojo.ClassificationTable;
import com.example.demo.pojo.CommodityList;
import com.example.demo.service.BackgroudGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BackgroudGoodsImpl implements BackgroudGoods {


    @Autowired
    CommodityListDao commodityListDao;

    @Autowired
    ClassificationTableDao classificationTableDao;


    //查找单个商品信息
    @Override
    public CommodityList findAloneGoods(int goods) {
        return  commodityListDao.findGoodsMessageByGoodsid(goods);
    }


    //查找单个商品的一级分类
    @Override
    public ClassificationTable findFirstClassifybysecond(int Second) {
     return classificationTableDao.findFirstBySecondid(Second);
    }


    //根据分类id查找具体分类详情
    @Override
    public ClassificationTable findClassify(int id) {
        return classificationTableDao.selectByPrimaryKey(id);
    }



}
